package com.JingYan.Thread;

/**
 * 减参数线程
 *
 * @author Dong_Jia_Qi on 2022/6/4
 */
public class DecThread extends Thread{
    public DecThread() {
    }

    public DecThread(Runnable target) {
        super(target);
    }

    public DecThread(ThreadGroup group, Runnable target) {
        super(group, target);
    }

    public DecThread(String name) {
        super(name);
    }

    public DecThread(ThreadGroup group, String name) {
        super(group, name);
    }

    public DecThread(Runnable target, String name) {
        super(target, name);
    }

    public DecThread(ThreadGroup group, Runnable target, String name) {
        super(group, target, name);
    }

    public DecThread(ThreadGroup group, Runnable target, String name, long stackSize) {
        super(group, target, name, stackSize);
    }

    @Override
    public void run() {
        for (int i = 0; i < 10000; i++) {
            synchronized (Counter.lock){
                Counter.count -= 1;
            }
        }
    }
}
